-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue-698, Save default user ref for cassandra #720
Conversation
c64ae6c
to
e758e98
Compare
func (c *Cassandra) NewDefaultUserSecret(username, password string) *k8scorev1.Secret { | ||
return &k8scorev1.Secret{ | ||
TypeMeta: metav1.TypeMeta{ | ||
Kind: models.SecretKind, | ||
APIVersion: models.K8sAPIVersionV1, | ||
}, | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: fmt.Sprintf(models.DefaultUserSecretNameTemplate, models.DefaultUserSecretPrefix, c.Name), | ||
Namespace: c.Namespace, | ||
Labels: map[string]string{ | ||
models.ControlledByLabel: c.Name, | ||
models.DefaultSecretLabel: "true", | ||
}, | ||
}, | ||
StringData: map[string]string{ | ||
models.Username: username, | ||
models.Password: password, | ||
}, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make this func generic
l.Info("Cassandra cluster has been created", | ||
"cluster ID", c.Status.ID, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this log. it's already been logged
@@ -895,6 +914,59 @@ func (r *CassandraReconciler) newWatchBackupsJob(c *v1beta1.Cassandra) scheduler | |||
} | |||
} | |||
|
|||
func (r *CassandraReconciler) createDefaultSecret(ctx context.Context, c *v1beta1.Cassandra, l logr.Logger) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please try to make it generic as well
ddc79cc
to
0785828
Compare
0785828
to
39c70f8
Compare
No description provided.